<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>test.html</title>
</head>

<body>
	<p>学生信息管理</p>
	<hr />
	<input id="runoob_id" placeholder="runoob_id" />
	<input id="runoob_author" placeholder="runoob_author" />
	<input id="runoob_title" placeholder="runoob_title" />
	<input type="button" id="submit" value="新增" />
	<input type="button" id='query' value="查询">
	<div class="board">

	</div>
</body>
<script type='text/javascript' src='https://code.jquery.com/jquery-3.2.1.js'></script>
<script>
	$("#submit").click(() => {
		const runoob_id = document.getElementById("runoob_id").value;
		const runoob_author = document.getElementById("runoob_author").value;
		const runoob_title = document.getElementById("runoob_title").value;
		$.ajax({
			type: 'get',
			url: 'http://140.143.122.74:8000/add',
			data: { runoob_id, runoob_author, runoob_title, submission_date: new Date() },
			async: true,
			success(e) {
				console.log(e);
			}
		});
	});
	$('#query').click(() => {
		$.ajax({
			type: 'get',
			url: 'http://140.143.122.74:8000/find',
			async: true,
			success(e) {
				console.log(e);
			}
		});
	});
</script>

</html>